package com.ssy.lingxi.product.api.feign;

import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.hystrix.CustomerAttributeValueProductHystrix;
import com.ssy.lingxi.product.api.model.response.CustomerAttributeValueResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @menu: 业务模块--属性值管理
 * 业务模块-属性值管理接口
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/24
 */
@FeignClient(value = "product-service", fallback = CustomerAttributeValueProductHystrix.class)
public interface ICustomerAttributeValueProductFeign {

    /**
     * 查询属性信息
     * @return Wrapper<?>
     */
    @RequestMapping(value = "/product/customer/getCustomerAttributeValueList", method = RequestMethod.GET)
    Wrapper<?> getCustomerAttributeValueList(PageVO pageVO, String name);

    /**
     * 查询属性值信息
     * @param id
     * @return Wrapper<?>
     */
    @RequestMapping(value = "/product/customer/getCustomerAttributeValue", method = RequestMethod.GET)
    Wrapper<?> getCustomerAttributeValue(@RequestParam Long id);

    /**
     * 新增/修改属性值
     * @param customerAttributeValue
     * @return
     */
    @RequestMapping(value = "/product/customer/saveOrUpdateCustomerAttributeValue", method = RequestMethod.POST)
    Wrapper<?> saveOrUpdateCustomerAttributeValue(@RequestBody CustomerAttributeValueResponse customerAttributeValue);

    /**
     * 删除属性值
     * @param id
     * @return
     */
    @RequestMapping(value = "/product/customer/deleteCustomerAttributeValue", method = RequestMethod.GET)
    Wrapper<?> deleteCustomerAttributeValue(@RequestParam Long id);

    /**
     * 启用/停用属性值
     * @param id
     * @param status
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/product/customer/updateCustomerAttributeValueStatus", method = RequestMethod.GET)
    Wrapper<?> updateCustomerAttributeValueStatus(@RequestParam Long id, @RequestParam Boolean status);
}
